package com.it.data.job

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlin.coroutines.CoroutineContext

// 自定义CoroutineScope
class CallCoroutineScope : CoroutineScope {
    private val job = Job()

    override val coroutineContext: CoroutineContext
        get() = Dispatchers.Default + job


    // 取消所有的协程（如果需要的话）
    fun cancelAll() {
        job.cancel()
    }
}
